package com.example.demo;




import com.mysql.cj.xdevapi.Session;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Properties;
import java.io.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;

import javax.activation.*;



/*
 *
 * */

@WebServlet("/sendEmail")
public class SendEmail extends HttpServlet {


    public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //收件人电子邮件ID
        String to = "906922090@qq.com";
        //
        String from = "906922090@qq.com";
        String host = "localhost";

        //获取系统的属性
        Properties properties = System.getProperties();

        //设置邮件服务器
        properties.setProperty("mail.smtp.host", host);

        //获取默认的session
//        Session session = Session.getDefaultInstance(properties);


        resp.setContentType("text/html;charset=UTF-8");

        PrintWriter out= resp.getWriter();

        try{

        }catch (Exception e){
            e.printStackTrace();
        }

    }


    public void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

    }
}
